import React, { Component } from 'react';
import { Input } from 'antd';
import { Button } from 'antd';
import { Row, Col } from 'antd';
export default class TodoInput extends Component {
  state = {
    val: ''
  }
  render() {
    let { val } = this.state;
    return (
      <div>

        <Row>
          <Col span={12}>
            <Input type="text" value={val} onChange={
              (e) => {
                this.setState({ val: e.target.value })
              }
            } /></Col>
          <Col span={12}>
            <Button type="primary" onClick={() => {
              this.props.addList(this.state.val)
            }}>添加</Button>
          </Col>
        </Row>



      </div>
    )
  }
}